#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;
int main(){
    int n;
    double x1,y1,x2,y2,sum;
    cin>>n;
    while (n--)
    {
        cin>>x1>>y1>>x2>>y2;
        sum=(x1*x2+y1*y2)/(sqrt(x1*x1+y1*y1)*sqrt(x2*x2+y2*y2));
        cout<<fixed<<setprecision(2)<<acos(sum)*180/acos(-1)<<endl;//acos(-1)代替pi
    }
    
}